const { chromium } = require('playwright');

const main = async () => {

     const browser = await chromium.launch();//模拟打开浏览器
     const page = await browser.newPage();//模拟打开一个页签

    await page.goto('https://www.baidu.com/');
    await page.screenshot({ path: 'image.png' });

    await page.close();
    await browser.close();
};

main();
